package com.aipartner.mapper;

import com.aipartner.entity.VipOrder;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * VIP Order Mapper Interface
 * 
 * @author AI Partner Team
 * @since 2024-01-20
 */
@Mapper
public interface VipOrderMapper extends BaseMapper<VipOrder> {
    
    /**
     * Get user VIP orders with pagination
     * 
     * @param page Page object
     * @param userId User ID
     * @return User VIP orders
     */
    IPage<VipOrder> selectUserOrders(Page<VipOrder> page, @Param("userId") Long userId);
    
    /**
     * Get orders by status
     * 
     * @param status Order status
     * @return Orders list
     */
    List<VipOrder> selectByStatus(@Param("status") Integer status);
    
    /**
     * Update order status
     * 
     * @param orderNo Order number
     * @param status New status
     * @return Number of affected rows
     */
    int updateOrderStatus(@Param("orderNo") String orderNo, @Param("status") Integer status);
}